<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="peoit" tagdir="/WEB-INF/tags"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<peoit:include>
	<div class="pd-20">
		<form action="<c:url value="/admin/permission/permissionUpdate"/>" method="post" class="form form-horizontal" id="form-permission-edit">

			<div class="row cl">
				<label class="form-label col-3"><span class="c-red">*</span>所在菜单：</label>
				<div class="formControls col-5">
					<span class="select-box"> <select name="inWhere" class="select" datatype="*" nullmsg="请选择权限所在的菜单">
							<option value="" selected>选择权限所在菜单</option>
							<option value="1" ${permission.inWhere == '1'?"selected":""}>会员管理</option>
							<option value="1-1" ${permission.inWhere == '1-1'?"selected":""}>会员列表</option>
							<option value="1-2" ${permission.inWhere == '1-2'?"selected":""}>会员审核</option>
							<option value="2" ${permission.inWhere == '2'?"selected":""}>项目管理</option>
							<option value="2-1" ${permission.inWhere == '2-1'?"selected":""}>项目列表</option>
							<option value="3" ${permission.inWhere == '3'?"selected":""}>资讯管理</option>
							<option value="3-1" ${permission.inWhere == '3-1'?"selected":""}>资讯列表</option>
							<option value="5" ${permission.inWhere == '5'?"selected":""}>Banner管理</option>
							<option value="5-1" ${permission.inWhere == '5-1'?"selected":""}>Banner列表</option>
							<option value="4" ${permission.inWhere == '4'?"selected":""}>系统管理</option>
							<option value="4-1" ${permission.inWhere == '4-1'?"selected":""}>管理员列表</option>
							<option value="4-2" ${permission.inWhere == '4-2'?"selected":""}>角色列表</option>
							<option value="4-3" ${permission.inWhere == '4-3'?"selected":""}>权限列表</option>
							<option value="4-4" ${permission.inWhere == '4-4'?"selected":""}>短信模板</option>
							<option value="4-5" ${permission.inWhere == '4-5'?"selected":""}>项目类型</option>
					</select>

					</span>
				</div>
				<div class="col-4"></div>
			</div>

			<div class="row cl">
				<label class="form-label col-3"><span class="c-red">*</span>父权限名称：</label>
				<div class="formControls col-5">
					<span class="select-box"> <select name="parentPermissionId" class="select" datatype="*" nullmsg="请选择父权限">
							<option value="">=====无=====</option>
							<c:forEach items="${viewData}" var="plist">
								<option value="${plist.id}" ${plist.id == permission.parentPermissionId?"selected":""}>${plist.description}</option>
							</c:forEach>
					</select>

					</span>
				</div>
				<div class="col-4"></div>
			</div>

			<div class="row cl">
				<label class="form-label col-3"><span class="c-red">*</span>权限名称：</label>
				<div class="formControls col-5">
					<input type="text" class="input-text" value="${permission.name}" placeholder="必须是英文字母加者下划线" id="user-name" name="name" datatype="s,*" errormsg="权限名称必须是英文字母加者下划线" nullmsg="权限名称不能为空"> <input type="hidden" value="${permission.id}" name="id">
				</div>
				<%--<div class="col-4" style="color: red;">必须是英文字母加者下划线</div>--%>
			</div>
			<div class="row cl">
				<label class="form-label col-3"><span class="c-red">*</span>描述：</label>
				<div class="formControls col-5">
					<input type="text" placeholder="请输入描述" name="description" autocomplete="off" value="${permission.description}" class="input-text" datatype="*">
				</div>
				<div class="col-4"></div>
			</div>

			<div class="row cl">
				<div class="col-9 col-offset-3">
					<input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
				</div>
			</div>
		</form>
	</div>
</peoit:include>
<script type="text/javascript">
	function refreshAndColse() {
		window.parent.location.href = window.parent.location;
	}

	$(function() {

		//表单验证ajax提交
		$("#form-permission-edit").Validform({
			tiptype : 3,
			callback : function(form) {
				$("#form-permission-edit").ajaxSubFromDialog(this);
				setTimeout(refreshAndColse, 1500);
				return false;
			}
		});

		$('.skin-minimal input').iCheck({
			checkboxClass : 'icheckbox-blue',
			radioClass : 'iradio-blue',
			increaseArea : '20%'
		});
	});
</script>